package one.stand.controller;

import one.stand.model.CompanyApplyRecordModel;
import one.stand.model.CompanyCategoryRelationModel;
import one.stand.model.ResultModel;
import one.stand.service.CompanyApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by yandou on 2019/6/14.
 */
@RestController
@RequestMapping("/company/apply")
public class CompanyApplyController extends BaseController {

    @Autowired
    protected CompanyApplyService companyApplyService;

    @PostMapping("category/del")
    public ResultModel categoryDel(@RequestBody CompanyCategoryRelationModel request) {
        return companyApplyService.categoryDel(request);
    }

    @PostMapping("category/add")
    public ResultModel categoryAdd(@RequestBody CompanyCategoryRelationModel request) {
        return companyApplyService.categoryAdd(request);
    }

    /**
     * 企业类目列表
     *
     * @param request
     * @return
     */
    @PostMapping("category/list")
    public ResultModel categoryList(@RequestBody CompanyCategoryRelationModel request) {
        return companyApplyService.categoryList(request);
    }

    @PostMapping("list")
    public ResultModel list(@RequestBody CompanyApplyRecordModel request) {
        return companyApplyService.list(request);
    }

    @PostMapping("updateState")
    public ResultModel updateState(@RequestBody CompanyApplyRecordModel request) {
        return companyApplyService.updateState(request);
    }

    @PostMapping("add")
    public ResultModel add(@RequestBody CompanyApplyRecordModel request) {
        return companyApplyService.add(request);
    }

}
